﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using CommonLib.Pattern.FSM;
public class EnemySTChase2Escape : EnemyStateTransitionBase
{

	public EnemySTChase2Escape(string _key, FSMStateBase _from, FSMStateBase _to, int _priority, RoleCtrl _role) : base(_key, _from, _to, _priority, _role)
	{

	}
	public override bool TransferValid()
	{
		TransitionParam tp = GetTransistionParam(TransitionParamType.Chase);
		float vigilance = tp.VigilanceEscape;
		if (FindNearestDangrous(vigilance, out Collider2D col))
		{
			(ToState as EnemyFSMStateBase).SetTarget(col);
			return true;
		}
		else
			return false;
	}

	public override bool OnCompleteCallBack()
	{
		return base.OnCompleteCallBack();
	}
}
